package com.boot.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultVO implements Serializable {
	private Integer code;
	private String message;
	private Object data;
	public static ResultVO success(String message, Object data) {
		return new ResultVO(StatusCode.SUCCESS_CODE, message, data);
	}
	
	public static ResultVO success(String message) {
		return new ResultVO(StatusCode.SUCCESS_CODE, message, null);
	}
	public static ResultVO fail(String message) {
		return new ResultVO(StatusCode.FAIL_CODE, message, null);
	}
}
